﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace System.Work.ClientEngine.FPXH
{
    public interface IFPXHClient : IDisposable
    {
        bool IsConnected { get; }

        event EventHandler<ReadDataEventArgs> OnReadCallback;
        event EventHandler<WriteDataEventArgs> OnWriteCallback;
        event EventHandler<ErrorDataEventArgs> OnErrorCallback;
        event EventHandler OnClientClosed;
        event EventHandler OnClientConnected;
        event EventHandler OnClientError;

        bool Connect();
        bool Disconnect();
        bool Read(string address);
        bool Read(string startAdd, string endAdd, int count);
        bool Write(string address, int value);
        bool Write(string startAdd, string endAdd, int count, int[] values);
    }
}
